//
//  TheModule_1.m
//  CaiPiao
//
//  Created by l wb on 2018/5/16.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "TheModule_1.h"
#import "ShufflingView.h"
@interface TheModule_1 ()
@property (weak, nonatomic) IBOutlet UIView *shufflingView;

@end

@implementation TheModule_1

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"首页";
    

    [self getAnnouncementOfTheData];
}
-(void)getAnnouncementOfTheData{
    BmobQuery *query = [[BmobQuery alloc] initWithClassName:@"Announcement"];
    
    [query findObjectsInBackgroundWithBlock:^(NSArray *array, NSError *error) {
        if (!error) {
            BmobObject *object = array[0];
            NSArray *arr = [object objectForKey:@"data"];
            
            [ShufflingView addShufflingViewToView:self.shufflingView viewHeight:27 data:arr controller:self];
        }
       
    }];
    
    
}
- (IBAction)goSchoolPageClickAction:(UIButton *)sender {
    [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"SchoolStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"SchoolController"] animated:YES];
    
    
}
#pragma mark -预测排行榜
- (IBAction)goForecastChartsPageClickAction:(UITapGestureRecognizer *)sender {
    [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"ForecastChartsStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"ForecastChartsController"] animated:YES];
    
    
    
}
#pragma mark -跳选号助手页面
- (IBAction)goSelectNumberPageClickAction:(UIButton *)sender {
    
        [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"SelectedNumber" bundle:nil] instantiateViewControllerWithIdentifier:@"LLForSelectedTableViewController"] animated:YES];
}
#pragma mark - 实用技巧
- (IBAction)goSkillsPageClickAction:(UIButton *)sender {

    [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"SkillsStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"SkillsController"] animated:YES];
}


#pragma mark - 每日精推
- (IBAction)recommendAction:(id)sender {
    [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"Recommend" bundle:nil] instantiateViewControllerWithIdentifier:@"RecommendViewController"] animated:YES];
}


- (IBAction)showMoreListAction:(id)sender {
    self.tabBarController.selectedIndex = 1;
}


#pragma mark - 开奖历史
- (IBAction)chooseLotteryHistoryAction:(UITapGestureRecognizer *)sender {
    UIView* tapView = sender.view;
    NSString* lotteryID = @"";
    NSString* lotteryName = @"";

    switch (tapView.tag) {
        case 101:
            lotteryID = @"4";
            lotteryName = @"大乐透";
            break;
        case 102:
            lotteryID = @"3";
            lotteryName = @"双色球";
            break;
        case 103:
            lotteryID = @"7";
            lotteryName = @"11选5";
            break;
        case 104:
            lotteryID = @"5";
            lotteryName = @"福彩3D";
            break;
        case 105:
            lotteryID = @"9";
            lotteryName = @"快3";
            break;
        case 106:
            lotteryID = @"6";
            lotteryName = @"排列3";
            break;
        default:
            break;
    }
    
    [LotteryManager sharedManager].currentLotteryID = lotteryID;
    [LotteryManager sharedManager].currentLotteryName = lotteryName;
    [self.navigationController pushViewController:[[UIStoryboard storyboardWithName:@"Announcement" bundle:nil] instantiateViewControllerWithIdentifier:@"AnnounceNumViewController"] animated:YES];
}


@end
